#ifndef BONDCONFIGDIALOG_H
#define BONDCONFIGDIALOG_H

#include <QDialog>
#include <QList>
#include <QString>
#include "networkinfo.h"

namespace Ui {
class BondConfigDialog;
}

class BondConfigDialog : public QDialog
{
    Q_OBJECT

public:
    explicit BondConfigDialog(const QList<ConnectionInfo>& selectedConns, QWidget *parent = nullptr);
    explicit BondConfigDialog(const QList<ConnectionInfo>& candidates, const QString& bondName, 
                             const QStringList& currentMembers, QWidget *parent = nullptr);
    ~BondConfigDialog();

    QString getBondName() const;
    QString getBondMode() const;
    int getMiiMonitorInterval() const;
    int getUpDelay() const;
    int getDownDelay() const;
    QList<QString> getSelectedDevices() const;
    void setBondName(const QString& name);
    void setSelectedDevices(const QList<QString>& devices);

private slots:
    void on_buttonBox_accepted();
    void on_buttonBox_rejected();

private:
    Ui::BondConfigDialog *ui;
    QList<ConnectionInfo> m_selectedConns;
    
    void setupBondModes();
    void setupDeviceList();
    void setupDeviceListForEdit(const QStringList& currentMembers);
    bool validateInput();
};

#endif // BONDCONFIGDIALOG_H 